#include "main.h"

#include <iostream>
#if (__CURRENT_PLATFORM__ == __LINUX_PLATFORM__)
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#endif

#include "ar8030_usb_tool.h"

using namespace std;

int search_param(int argc, char* argv[], const char* flag)
{
    int i = 0;
    for (i = 0; i < argc; ++i)
    {
        if (0 == strcmp(argv[i], flag))
        {
            return i;
        }
    }
    return -1;
}

int get_param(int argc, char* argv[], const char* flag)
{
    int ret = -1;
    ret = search_param(argc, argv, flag);
    if (ret >= 0)
        return ret + 1;
    return ret;
}

int main(int argc, char* argv[])
{
    setvbuf(stdout, NULL, _IONBF, 0);
    class ar8030_usb_tool* usb_tool = new ar8030_usb_tool();
    int ret = 0;

    ret = usb_tool->usb_tool_command_parse(argc, argv);
        
    return ret;
}
